<html lang="java">
<head>
    <title>123</title>
    <script type="text/javascript">
        window.onload = function () {
            var  submit=  document.getElementById("submit");

            var  newPassword=  document.getElementById("newPassword");
            var  snewPassword=  document.getElementById("snewPassword");
            newPassword.onblur = checknewPassword;
            function  checknewPassword(){
                return   check(newPassword,snewPassword,"输入新密码");
            }

            var  rePassword=  document.getElementById("rePassword");
            var  srePassword=  document.getElementById("srePassword");
            rePassword.onblur = checkrePassword;
            function  checkrePassword(){
                return   check(rePassword,srePassword,"再次输入");
            }

            function  check(view,s,text){
                var value = view.value ;
                if(value==null ||value=="" ){
                    s.innerHTML=text+"不能为空";
                    view.focus();
                    return  false;
                }
                else{
                    s.innerHTML="";
                    return true;
                }
            }

            submit.onclick = function () {
                if (checknewPassword() && checkrePassword()){
                    if (newPassword.value === rePassword.value){
                        return  true;
                    }
                    else {
                        srePassword.innerHTML="两次输入的密码不一致";
                        return  false;
                    }
                }
                return  false;
            }
        }
    </script>
    <style type="text/css">
        span{
            color:red ;
        }
        body
        {
            background-size: 100% 100%;
            height: 100%;
            width: 100%;
            text-align: center;
            margin-top: 50px;
            margin-left: auto;
        }
        table{
            text-align: center;
            margin: auto;
            text-decoration-color: #E3E6EB;
        }
        h1{
            font-size: 35px;
            color: #5d5a8b;
        }
    </style>
</head>
<body background="/static/img/6.jpg" >
<h1>重置密码</h1>
<form action="/record/updateemppwd" method="post">
    <input type="hidden" name="eId" value="${eId!''}"/>
    <table cellpadding="4" cellspacing="1" >
        <tr>
            <td>输入新密码：</td>
            <td><input type="password" value="" name="newPassword" id="newPassword"/><span id="snewPassword"></span></td>
        </tr>
        <tr>
            <td>再次输入：</td>
            <td><input type="password" value=""  name="rePassword" id="rePassword"/><span id="srePassword"></span></td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: center">
                <input onclick="location.href='/record/selectemployee'" type="button" value="返回">
                <input type="submit" value="提交" id="submit">
            </td>
        </tr>
    </table>
</form>

</body>
</html>